 <!DOCTYPE html>
 <html lang="zh-CN">
 <head>
    <meta charset="UTF-8">
    <title>17_margin合并的问题</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
        }
        .box1 {
            background-color: deepskyblue;
            margin-bottom: 50px;
        }
        .box2 {
            background-color: deeppink;
            margin-top: 50px;
        }
        .text {
            width: 200px;
            height: 200px;
            display: inline-block;
        }
        .texta {
            background-color: purple;
            margin-right: 50px;
        }
        .textb {
            background-color: orange;
            margin-left: 50px;
        }
    </style>
 </head>
 <body>
    <div class="box box1">1</div>
    <div class="box box2">2</div>
    <hr>
    <div class="text texta">a</div>
    <div class="text textb">b</div>
 </body>
 </html>